using System;
using System.Runtime.InteropServices;

namespace KodeIT.Web
{
    /// <summary>
    /// This enumeration represents the possible native values used to indicate how the native
    /// ISAPI Filter handled the event.
    /// </summary>
    [ComVisible(true)]
    public enum FilterStatus
    {
        /// <summary>
        /// The filter has handled the HTTP request. The server should disconnect the session.
        /// </summary>
        Finished = 0x8000000,

        /// <summary>
        /// This is the same as <see cref="FilterStatus.Finished"/>, except that the server should keep the TCP session open if the option was negotiated.
        /// </summary>
        FinishedKeepConn,
        
        /// <summary>
        /// The next native filter in the notification chain should be called.
        /// </summary>
        NextNotification,

        /// <summary>
        /// This native filter handled the notification. No other handlers should be called for this particular notification type.
        /// </summary>
        HandledNotification,

        /// <summary>
        /// Tells IIS that an error occurred during the processing of the request. The filter should call SetLastError 
        /// with the nature of the failure, otherwise the client might get an unexpected response. IIS looks at 
        /// GetLastError and the notification where the error occurred to decide what error to send to the client. 
        /// For example, if the filter calls SetLastError with a "File not found" error, IIS will return a 404 to the client.
        /// </summary>
        Error,

        /// <summary>
        /// The filter is an opaque stream filter (encrypted/compressed HTTP requests) and the session parameters 
        /// are being negotiated. This is valid only for raw-read notification. This notification indicates that 
        /// the full request has not yet been received; the Web server should issue another read and notify the 
        /// filter with the additional data read.
        /// </summary>
        ReadNext
    }
}
